package logic;


import java.util.HashMap;

/**
 * Acts as a container for meta data.
 * 
 * @author wernerflatz
 *
 */
public class Property {
	
	private HashMap<String, Object> m_Properties;
	
	public Property() {
		m_Properties = new HashMap<String, Object>();
	}
	
	public Property(HashMap<String, Object> properties) {
		m_Properties = properties;
	}
	
	@Override
	public boolean equals(Object obj) {
		Property temp;
		
		if (obj instanceof Property) {
			temp = (Property) obj;
			
			if (temp.m_Properties.get("name").equals(m_Properties.get("name"))) {
				return true;
			}
		}
		return false;
	}

	public HashMap<String, Object> getProperties() {
		return m_Properties;
	}

	public void setProperties(HashMap<String, Object> properties) {
		m_Properties = properties;
	}
	
	public void addProperty(String key, Object obj) {
		m_Properties.put(key, obj);
	}
	
	public Object getProperty(String key) {
		return m_Properties.get(key);
	}
	
}
